/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.bean.model.UserScoreRecord;
import com.yami.shop.dao.UserScoreRecordMapper;
import com.yami.shop.service.UserScoreRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * @author lgh on 2018/09/11.
 */
@Service
public class UserScoreRecordServiceImpl extends ServiceImpl<UserScoreRecordMapper, UserScoreRecord> implements UserScoreRecordService {

    @Autowired
    private UserScoreRecordMapper userScoreRecordMapper;


    @Override
    public void addScoreRecord(String userId, double score, Integer type,String mark) {
        UserScoreRecord r = new UserScoreRecord();
        r.setUid(userId);
        r.setType(type);
        r.setAmount(score);
        r.setMark(mark);
        r.setCreateTime(new Date());
        save(r);
    }

    @Override
    public void addScoreRecord(String userId, double score, Integer type) {
        addScoreRecord(userId,score,type,"");
    }
}
